package com.jmu.medicineknows.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jmu.medicineknows.entity.Menu;
import com.jmu.medicineknows.entity.Result;
import com.jmu.medicineknows.entity.User;
import com.jmu.medicineknows.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Administrator
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 获取权限信息
     * @param id
     * @return List<String>
     */
    List<String> selectPermsByUserId(Long id);

    /**
     * 获取用户菜单
     * @param id
     * @return List<Menu>
     */
    List<Menu> selectMenuByUserId(Long id);
    /**
     * 注册时插入用户与角色表相应的记录
     * @Param: user
     * @return
     */
    void insertUserRole(User user);
    /**
     * 更改用户角色
     * @Param: userRole
     * @return
     */
    void updateUserRole(UserRole userRole);
}
